﻿using System;
using Me.Amon.CRM.C;

namespace Me.Amon.CRM.M
{
    public class MCustomer : MCrm
    {
        public string Id { get; set; }

        public string Code { get; set; }

        /// <summary>
        /// 姓
        /// </summary>
        public string LastName { get; set; }
        /// <summary>
        /// 名
        /// </summary>
        public string FirstName { get; set; }
        /// <summary>
        /// 显示名称
        /// </summary>
        public string DisplayName { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public int Sex { get; set; }
        public string SexName
        {
            get
            {
                switch (Sex)
                {
                    case CCustomer.SEX_MALE:
                        return "先生";
                    case CCustomer.SEX_FEMALE:
                        return "女士";
                    default:
                        return "未知";
                }
            }
        }

        public int Grade { get; set; }
        public string GradeName
        {
            get
            {
                switch (Grade)
                {
                    case CCustomer.GRADE_0:
                        return "无";
                    case CCustomer.GRADE_1:
                        return "普通会员";
                    case CCustomer.GRADE_2:
                        return "白银会员";
                    case CCustomer.GRADE_3:
                        return "黄金会员";
                    case CCustomer.GRADE_4:
                        return "钻石会员";
                    case CCustomer.GRADE_5:
                        return "皇冠会员";
                    default:
                        return "其它";
                }
            }
        }

        public int Point { get; set; }

        public DateTime Birthday { get; set; }

        public MCustomer()
        {
        }

        public bool IsBirthday()
        {
            var now = DateTime.Now;
            return now.Year == Birthday.Year && now.Month == Birthday.Month && now.Day == Birthday.Day;
        }
    }
}
